<template>
  <el-container style="border: 1px solid #eee">
<!--    <el-header style="text-align: right; font-size: 12px;background-color: gray">-->
<!--      &lt;!&ndash;        <el-dropdown>&ndash;&gt;-->
<!--      &lt;!&ndash;          <i class="el-icon-setting" style="margin-right: 15px"></i>&ndash;&gt;-->
<!--      &lt;!&ndash;          <el-dropdown-menu slot="dropdown">&ndash;&gt;-->
<!--      &lt;!&ndash;&lt;!&ndash;            <el-dropdown-item>查看</el-dropdown-item>&ndash;&gt;&ndash;&gt;-->
<!--      &lt;!&ndash;&lt;!&ndash;            <el-dropdown-item>新增</el-dropdown-item>&ndash;&gt;&ndash;&gt;-->
<!--      &lt;!&ndash;            <el-dropdown-item @click=exit()>退出登录</el-dropdown-item>&ndash;&gt;-->
<!--      &lt;!&ndash;          </el-dropdown-menu>&ndash;&gt;-->
<!--      &lt;!&ndash;        </el-dropdown>&ndash;&gt;-->
<!--      <span style="font-size: 16px">欢迎！{{ expert.username }}</span>-->
<!--      <el-button style="background-color: gray;color: black;border: gray;font-size: 8px" @click="exit()" class="el-icon-circle-close">退出登录</el-button>-->
<!--    </el-header>-->
    <el-header style="font-size: 12px;background-color: gray">
      <div style="float: right;display: inline">
        <span style="font-size: 16px;">欢迎！{{ expert.username }}</span>
        <el-button style="background-color: gray;color: black;border: gray;font-size: 16px" @click="exit()" class="el-icon-circle-close">退出登录</el-button>
      </div>
      <div style="display: inline">
        <span style="font-size: 20px;color: white" class="el-icon-s-home">中小学教学质量信息采集及评估系统</span>
      </div>
    </el-header>
    <el-container>
      <el-aside width="200px" style="background-color: #304156">
        <el-menu router
           :background-color="variables.menuBg"
           :active-text-color="variables.menuActiveText"
           :text-color="variables.menuText">
          <!--        v-if="item.show" 控制边栏板块的展示-->
          <!--        <el-submenu v-for="(item,index) in $router.options.routes" :index="index+''" v-if="item.show">-->
          <!--        <el-submenu index="1">-->
          <!--          <template slot="title">评审任务发表</template>-->
          <router-link to="EvaluateIndexListForExpert" active-class="active"><el-menu-item><i class="el-icon-s-tools"></i>评估体系设置</el-menu-item></router-link>
<!--          <router-link to="EvaluateIndex123ForExpert" active-class="active"><el-menu-item>评估指标</el-menu-item></router-link>-->
<!--          <router-link to="EvaluateTaskListForExpert" active-class="active"><el-menu-item><i class="el-icon-document"></i>评估任务安排</el-menu-item></router-link>-->
          <router-link to="EvaluateTaskArrangeForExpert" active-class="active"><el-menu-item><i class="el-icon-files"></i>评估任务评审</el-menu-item></router-link>
          <!--        </el-submenu>-->
          <!--        <el-submenu index="2">-->
          <!--          <template slot="title">评估管理</template>-->
          <!--          <router-link to="SchoolList" active-class="active"><el-menu-item>管理员账号</el-menu-item></router-link>-->
          <!--          <router-link to="SchoolHost" active-class="active"><el-menu-item>学校账号</el-menu-item></router-link>-->
          <!--          <router-link to="SchoolType" active-class="active"><el-menu-item>专家账号</el-menu-item></router-link>-->
          <!--          &lt;!&ndash;          <router-link to="SchoolLocationType" active-class="active"><el-menu-item>学校驻地城乡类型</el-menu-item></router-link>&ndash;&gt;-->
          <!--          &lt;!&ndash;          <router-link to="test" active-class="active"><el-menu-item>测试</el-menu-item></router-link>&ndash;&gt;-->
          <!--        </el-submenu>-->
          <!--        &lt;!&ndash;        <el-submenu v-for="(item,index) in $router.options.routes" :index="index+''" v-if="item.show">&ndash;&gt;-->
          <!--        <el-submenu index="3">-->
          <!--          <template slot="title">系统管理</template>-->
          <!--          <router-link to="AdminList" active-class="active"><el-menu-item>管理员账号</el-menu-item></router-link>-->
          <!--          <router-link to="SchoolUserList" active-class="active"><el-menu-item>学校账号</el-menu-item></router-link>-->
          <!--          <router-link to="ExpertList" active-class="active"><el-menu-item>专家账号</el-menu-item></router-link>-->
          <!--          &lt;!&ndash;          <router-link to="test" active-class="active"><el-menu-item>测试</el-menu-item></router-link>&ndash;&gt;-->
          <!--          &lt;!&ndash;          <router-link to="SchoolLocationType" active-class="active"><el-menu-item>学校驻地城乡类型</el-menu-item></router-link>&ndash;&gt;-->
          <!--          &lt;!&ndash;          <router-link to="test" active-class="active"><el-menu-item>测试</el-menu-item></router-link>&ndash;&gt;-->
          <!--        </el-submenu>-->
        </el-menu>
      </el-aside>
      <el-main>
        <router-view></router-view>
      </el-main>
    </el-container>
  </el-container>
</template>

<script>
import variables from '@/assets/variables.scss'
export default {
  name: "index",
  data(){
    return{
      expert:''
    }
  },

  methods:{
    exit(){
      const d=confirm("确定退出吗？");
      if (d){
        this.$router.push("/login")
      }

    }
  },
  created() {
    const e=localStorage.getItem("access-expert")
    if (e){
      this.expert=JSON.parse(window.localStorage.getItem('access-expert'))
    }
    else{
      this.$alert('未登录','提示',{
        confirmButtonText:'确定'
      }).then((res)=>{
        this.$router.replace({path:'/login'})
      })
    }
  },
  computed:{
    variables() {
      return variables
    },
  }
}
</script>

<style scoped>
a {
  text-decoration: none;
}

.router-link-active {
  text-decoration: none;
}
.router-link{
  text-decoration: none;
}
</style>
